<template>
  <div style="padding: 0 10px">
    <div class="fw-bold c-5e5e5e">{{Q['xh']}}、
      <span v-html="Q['nr']"></span>
    </div>
    <div class="mt-14" style="max-width: 800px;" v-if="Q['pic'][0]">
      <img class="w100" v-lazy="Q['pic'][0]">
    </div>
    <div class="mt-20">
      {{Q.yx_da[0]}}
    </div>
    <div class="choose-info mt-20 clearfix">
      <div class="float-right fz12 c-a5a5a5">
        <div class="inline-block cursor-pointer">
          <p v-if="Q['collect_zt'] === 1" @click="collect_Q(0)">
            <span class="icon fa fa-star mr-4 c-ff9800 fz14 align-0"></span>已收藏
          </p>
          <p v-else @click="collect_Q(1)">
            <span class="icon fa fa-star mr-4 fz14 align-0"></span>收藏
          </p>
        </div>
        <!--<p class="cursor-pointer inline-block Q-fix-wrong ml-22">-->
        <!--<span class=" md  fz14" style="vertical-align: -2.5px;">highlight_off</span>-->
        <!--纠错-->
        <!--</p>-->
      </div>
    </div>
    <div class="p-panel p-border-2 mt-20 bg-fbfbfb explain">
      <div>
        <p class="inline-block c-0084b3">
          <span class="md fz16 align-y-bottom mr-4">assignment</span>
          我的答案：{{Q['yx_da'][0] || '未答题'}}
        </p>
      </div>
      <div class="detail mt-24">
        <div class="float-left c-666" style="margin-left: -104px;">
          <span class="md fz16 align-y-bottom mr-4">assignment</span>
          参考解析：
        </div>
        {{Q['da'] || '暂无'}}
      </div>
      <div class="mt-14" style="max-width: 800px;" v-if="Q['pic2'][0]">
        <img class="w100" v-for="(item, index) in Q['pic2']" :key="index" v-lazy="item">
      </div>
    </div>
  </div>
</template>

<script>
  export default {
    props: {
      Q: {
        type: Object,
        required: true,
      },
      request_id:{
        type:String
      }
    },
    data() {
      return {
        letter_json: window.$plus.letter_caps,
      };
    },
    methods: {
      collect_Q(zt) {
        const Q = this.Q;
        this.$api.paper.collect_Q({
          token:this.$store.state.$user.token,
          lb_id: this.$route.params.product_id,
          sj_id: Q.sj_id,
          st_id: Q.id,
          lx: 'collect',
          zt,
          request_id:this.request_id
        }).then(rst => {
          if (rst.data.event === '100') {
            Q['collect_zt'] = zt;
          } else {
            this.$Modal.info({title: '提示', content: rst.data.msg});
          }
        });
      },
    },
  };
</script>

<style scoped lang="scss">
  //修复错误
  .Q-fix-wrong:hover {
    color: #0084B3;
  }

  //解析
  .explain {
    padding: 20px;
    .detail {
      padding-left: 104px;
    }
  }
</style>
